<!DOCTYPE html>
<html>
<head>
    <title>搜索用户</title>
</head>
<body>
    <h1>搜索用户</h1>
    <form id="searchForm">
        <label>搜索词: <input type="text" name="search_term"></label>
        <button type="submit">搜索</button>
    </form>
    <div id="results"></div>

    <script>
        document.getElementById('searchForm').addEventListener('submit', async (e) => {
            e.preventDefault();
            const formData = new FormData(e.target);
            const response = await fetch('/search', {
                method: 'POST',
                body: formData
            });
            const result = await response.json();
            document.getElementById('results').innerHTML = JSON.stringify(result, null, 2);
        });
    </script>
</body>
</html>